package streaming;

import simulation.Simulator;

public class WaitingFor {
	int chunkId; // the chunk id

	double timeRequested; // when was the chunk request
	
	public WaitingFor(int chunkId, double timeRequested){
		this.setChunkId(chunkId);
		this.setTimeRequested(timeRequested);
	}
	
	public boolean isTimeout(){
		double time = this.getTimeRequested() + StreamingConfig.RECEIVE_TIMEOUT;
		boolean timeout = false; 
		
		if (time <= Simulator.getInstance().getTime()) {
			timeout = true;
		}
		
		return timeout;
	}
	
	public int getChunkId() {
		return chunkId;
	}

	public void setChunkId(int chunkId) {
		this.chunkId = chunkId;
	}

	public double getTimeRequested() {
		return timeRequested;
	}

	public void setTimeRequested(double timeRequested) {
		this.timeRequested = timeRequested;
	}
	
}
